reverse Polish notation

Học thuật
Thân thiện
Definition

Noun: A method for writing mathematical expressions without parentheses, where each operator is placed after its operands. This format eliminates the need for grouping symbols like brackets by defining a strict order of evaluation.

Usage

Reverse Polish Notation (RPN) is used in some computer science and calculator applications to unambiguously represent arithmetic and logical expressions. - The programmer implemented a stack-based calculator that uses reverse polish notation for expression evaluation. - To calculate (3 + 4) * 5, you would write 3 4 + 5 * in reverse polish notation.

Advanced Usage
  • Stack-Based Evaluation: RPN is naturally evaluated using a data structure called a stack. Operands are pushed onto the stack, and operators pop the required number of operands off the stack, compute the result, and push it back on.
    • The algorithm for evaluating reverse polish notation is a classic example of stack manipulation.
Variants and Related Words
  • Postfix Notation: A synonym for Reverse Polish Notation.
    • Postfix notation is another name for the same concept.
  • Polish Notation: The related concept where operators precede their operands, also known as prefix notation.
    • Polish notation, invented by Jan Łukasiewicz, places the operator before the operands.
Synonyms
  • Postfix Notation
  • Suffix Notation
Related Terms and Concepts
  • Infix Notation: The standard notation where operators are placed between operands (e.g., ), which often requires parentheses to clarify order.
  • Stack: A fundamental data structure (Last-In, First-Out) used to evaluate RPN expressions.
  • Operator: A symbol (like , , ) that represents a mathematical operation.
  • Operand: A quantity on which an operation is performed.
Noun
  1. a parenthesis-free notation for forming mathematical expressions in which each operator follows its operands